ComponentOne Data Source for Entity Framework
C1.Data.Entities Namespace / EntityFrameworkExtensions Class / AsLive Method / AsLive<T>(ICollection<T>,EntityClientScope) Method
The type of the entities in the pocoCollection.
The entity collection to convert. It must be of type System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.
The EntityClientScope to which the entity owning this collection belongs (in which it was fetched by a query or created).

In This Topic
    AsLive<T>(ICollection<T>,EntityClientScope) Method
    In This Topic
    Converts a POCO System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1 to an editable live view.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function AsLive(Of T As Class)( _
       ByVal pocoCollection As System.Collections.Generic.ICollection(Of T), _
       ByVal scope As EntityClientScope _
    ) As View(Of T)
    public static View<T> AsLive<T>( 
       System.Collections.Generic.ICollection<T> pocoCollection,
       EntityClientScope scope
    )
    where T: class

    Parameters

    pocoCollection
    The entity collection to convert. It must be of type System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.
    scope
    The EntityClientScope to which the entity owning this collection belongs (in which it was fetched by a query or created).

    Type Parameters

    T
    The type of the entities in the pocoCollection.

    Return Value

    The resulting live view.
    Exceptions
    ExceptionDescription
    The pocoCollection is not of type System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.
    Remarks
    When POCO objects are used (with proxies), navigation collection properties are typed as System.Collections.Generic.ICollection`1, not System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1 (although they are System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1 at run time). That is why a special AsLive extension method must be used.
    See Also